<?php
//////////////////////////////////////////////////////
// GPAC Database is Copyright 2002 Colin Todd       //
// Written by Colin Todd - All rights reserved.     //
//                                                  //
// colintodd@myfastmail.com                         //
//////////////////////////////////////////////////////
$root = '../';
include($root . 'include/config.php');



/* Connecting, selecting database */
    $link = mysql_connect("localhost", "root", "")
        or die("Could not connect : " . mysql_error());
    print "Connected successfully<br />";
//    mysql_select_db("my_database") or die("Could not select database");
	mysql_select_db("churts_test1") or die("Could not select database");

    /* Performing SQL query */
$sql = "SELECT * FROM `individual` WHERE FamilyId NOT IN (SELECT FamilyId FROM Family ) ORDER BY `FamilyId` ASC LIMIT 0, 30"; 


echo "$sql<p>";

	$result = mysql_query($sql) or die("Query failed : " . mysql_error());

    /* Printing results in HTML */
	print "<table border=1>\n";
    while ($line = mysql_fetch_row($result)) 
	{
		$Count_fam = 0;
		$indv_data = "";
        print "\t<tr>\n";
        foreach ($line as $col_value) {
            print "\t\t<td>".$col_value."</td>\n";
		}
        print "\t</tr>\n";
		
	}
    print "</table>\n";

    /* Free resultset */
    mysql_free_result($result);

    /* Closing connection */
    mysql_close($link);

?>